<template>
	<view class="home">
		<view class="tabs_monitor">
			<view class="tabs_i" v-for="(i,index) in monitorArr" :key="index" @click="monitorFn(i.text)">
				<image class="img" :src="i.img" mode=""></image>
				<view class="text">
					<view class="">
						{{i.text}}
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				monitorArr: [{
					img: require('@/static/home/celaa.png'),
					text: '自动测量'
				}, {
					img: require('@/static/home/celab.png'),
					text: '手动测量'
				}],
			}
		},
		onLoad(option) {

		},
		methods: {
			monitorFn(i) {
				console.log('i', i);
				if (i == '自动测量') {
					if (this.vuex_devicename == '') {
						uni.showToast({
							title: '蓝牙未连接',
							duration: 2000
						});
						return
					}
					uni.navigateTo({
						url: '/pagesA/aproductA/measureLiusuyi?&ty=' + 'zd'
					});
				}
				if (i == '手动测量') {
					uni.navigateTo({
						url: '/pagesA/aproductA/measureLiusuyi?&ty=' + 'sd'
					});
				}
				// if (i == '输入计算') {
				// 	uni.navigateTo({
				// 		url: '/pagesA/aproductA/automaticCalCezhan'
				// 	});
				// }
				// if (i == '添加流速仪') {
				// 	uni.navigateTo({
				// 		url: '/pagesA/aproductA/saveLiusuyiList'
				// 	});
				// }
				// if (i == '添加渠道断面') {
				// 	uni.navigateTo({
				// 		url: '/pages/cezhanguanli/increase'
				// 	});
				// }
			}
		}
	}
</script>
<style scoped lang="scss">
	// 水情
	.tabs_monitor {
		padding: 30rpx;

		.tabs_i {
			margin-bottom: 20rpx;
			padding: 30rpx;
			border-radius: 20rpx;
			text-align: center;
			background-color: #ffffff;
			display: flex;
			align-items: center;
			justify-content: space-around;

			.img {
				width: 120rpx;
				height: 120rpx;
			}

			.text {
				width: 450rpx;
				color: #000000;
				font-size: 60rpx;
			}
		}
	}
</style>
<style>
	page {
		background-color: #d5e8f1;
	}
</style>